Computer technology has evolved and improved at incredibly fast rates. State of the art computer architectures are rendered obsolete in a relatively short amount of time as quicker and more powerful machines arc continuously designed and marketed. As a consequence of this rapid improvement in computer technology, many users experience difficulties in maintaining computer systems that are up to date with the current standards in computer technology.
One of the difficulties experienced in maintaining state of the art computers is the fact that computer code compatible with a user's current computer architecture may be incompatible with the architecture of a new computer. If the user is unable to run previously written code on a new computer architecture, then the cost of upgrading is significantly increased. As a result, translation systems have been designed which allow a user to translate original code compatible with one architecture into translated code compatible with a second architecture. After translating original code into translated code, the second architecture executes the translated code instead of the original code. Therefore, translation systems enable a user to run previously written code on different computer systems so that the user may upgrade or change his computer system without incurring the cost of losing existing code.
Translation systems can also be used to achieve other functionality. For example, translation systems can be used to translate existing code into a more efficient form so the code can be executed by the computer system more efficiently. Hence, computer code does not necessarily have to be originally incompatible with a computer system for the implementation of translation systems to be desirable.
In translating code from one form into another, attempts have been made to simply compile existing code into a new form of code capable of independently executing on the new architecture. However, this type of translation is difficult since information regarding control flow is only available at run time. Furthermore, each instruction of the existing code would have to be translated by the translation system prior to running the translated code on the new system. This could be a very time consuming process for users with large amounts of code.
Therefore, it is desirable for the translation process be dynamic in that the translation of current code occurs at run time and only the portion of the code actually used at run time is translated. Not only can a dynamic translation system make use of run time information, but a dynamic translation system may be incorporated within the architecture of a new computer so that existing code automatically runs on the new architecture making the translation process transparent to the user.
A problem experienced by dynamic translation systems is the occurrence of a synchronous fault. As known in the art, a synchronous fault occurs when an unexecutable command is detected. Synchronous faults may occur due to a variety of reasons including, but not limited to, programming errors existing in the original code or hardware changes that have occurred since the programming of the original code.
In order to appropriately process a synchronous fault, the "machine state" of the computer needs to be known. The machine state of a computer refers to the mathematical values currently stored within the computer that indicate the computer's current status. As an example, the machine state includes, but is not limited to, the values of the computer's flags, registers, and counters.
As known in the art, the execution of translated code produces a different machine state than the execution of the original code. Furthermore, when a translated instruction faults, it is important for the new architecture to know the machine state that would have been produced by a corresponding fault in the original code if the original code had been executing instead of the translated code. Therefore, it is necessary for a translation system to be capable of providing a computer with the machine state that would have been produced at the occurrence of a synchronous fault by the original code even though the translated code is actually executing.
One prior art implementation for providing the original code machine state is an inflexible correlation translation system. In this implementation, each machine state value of the original architecture is related to a particular machine state value of the new architecture. For example, a register in the original architecture is related to a particular register in the new architecture. Accordingly, the value in the particular register of the new architecture constantly reflects the value that would have existed in the original architecture if the original architecture would have been running the original code. Although this implementation is capable of keeping track of the machine state of the original code, optimal execution of the translated code does not occur because particular data must always be stored in particular locations of the new architecture.
Another prior art implementation allows a more flexible use of the data locations within the new architecture. However, in order to provide the machine state of the original code upon the occurrence of a synchronous fault, the prior art implementation keeps track of the machine state of the original code as the translated code executes. Therefore, the instruction and state mappings for each instruction capable of faulting is saved so that the machine state may be retrieved in the event of a synchronous fault. While this implementation allows free use of the new computer's registers, the additional storage requirements drastically affect the performance of the execution of the translated code.
Thus, a heretofore unaddressed need exists in the industry for a system and method for more efficiently translating original computer code into code compatible with a new architecture.